package eteam.aps.controller;

import eteam.aps.common.R;
import eteam.aps.common.exceptions.AuthException;
import eteam.aps.common.helper.JsonPage;
import eteam.aps.model.entity.Depot;
import eteam.aps.model.vo.DepotVo;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

public interface IDepotController {

    @PostMapping("/de/insert")
    R<Integer> insert(@RequestBody Depot depot) throws Exception, AuthException;

    @PostMapping("/de/delete/{fId}")
    R<Integer> delete(@PathVariable String fId) throws Exception, AuthException;

    @PostMapping("/de/update")
    R<Integer> update(@RequestBody Depot depot) throws Exception, AuthException;

    @PostMapping("/de/selectAll")
    R<JsonPage<DepotVo>> selectAll(
            @RequestParam(value = "fDepotCode",required = false) String fDepotCode,
            @RequestParam(value = "fDepotName",required = false) String fDepotName,
            @RequestParam("page") Integer page,@RequestParam("pageSize") Integer pageSize
            ) throws Exception, AuthException;

    @PostMapping("/de/selectDetails/{fId}")
    R<DepotVo> selectDetails(@PathVariable String fId) throws Exception, AuthException;
}
